com.sponsorpay.sdk.android.advertiser
Class AdvertiserHostInfo

java.lang.Object
  extended by com.sponsorpay.sdk.android.DeviceInfo
      extended by com.sponsorpay.sdk.android.advertiser.AdvertiserHostInfo

public class AdvertiserHostInfo
extends DeviceInfo

Retrieves and contains all the information from DeviceInfo plus the SponsorPay Offer ID contained in the Android Application Manifest.


Field Summary
private  java.lang.String mOfferId
          The Offer ID value defined in the manifest.
private  java.lang.String mProgramId
           
private  boolean mShouldUseProgramId
           
private static java.lang.String SPONSORPAY_OFFER_ID_KEY
          The SponsorPay Offer ID Key that is used in the AndroidManifest.xml file.
private static java.lang.String SPONSORPAY_PROGRAM_ID_KEY
           
 
Fields inherited from class com.sponsorpay.sdk.android.DeviceInfo
mContext
 
Constructor Summary
AdvertiserHostInfo(Context pContext)
          Constructor.
 
Method Summary
 java.lang.String getOfferId()
          Extracts the Offer ID from the host application's Android Manifest XML file.
 java.lang.String getProgramId()
           
 void setOverriddenOfferId(java.lang.String offerId)
          Set the offerId, overriding the one which would be read from the manifest.
 void setOverriddenProgramId(java.lang.String programId)
           
 void setShouldUseProgramId(boolean value)
           
 boolean shouldUseProgramId()
           
 
Methods inherited from class com.sponsorpay.sdk.android.DeviceInfo
getLanguageSetting, getLongFromAppMetadata, getOsVersion, getPhoneVersion, getStringFromAppMetadata, getUDID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPONSORPAY_OFFER_ID_KEY

private static final java.lang.String SPONSORPAY_OFFER_ID_KEY
The SponsorPay Offer ID Key that is used in the AndroidManifest.xml file.

See Also:
Constant Field Values

SPONSORPAY_PROGRAM_ID_KEY

private static final java.lang.String SPONSORPAY_PROGRAM_ID_KEY
See Also:
Constant Field Values

mShouldUseProgramId

private boolean mShouldUseProgramId

mOfferId

private java.lang.String mOfferId
The Offer ID value defined in the manifest.


mProgramId

private java.lang.String mProgramId
Constructor Detail

AdvertiserHostInfo

public AdvertiserHostInfo(Context pContext)
Constructor. Requires an Android application context which will be used to retrieve information from the device and the host application's Android Manifest.

Parameters:
pContext - Android application context.
Method Detail

shouldUseProgramId

public boolean shouldUseProgramId()

setShouldUseProgramId

public void setShouldUseProgramId(boolean value)

getOfferId

public java.lang.String getOfferId()

Extracts the Offer ID from the host application's Android Manifest XML file. If it's not present, it will throw a RuntimeException.

If the Offer Id has already been set (i.e. by calling #setOverridenOfferId(String)), this method will just return the id which has been set without trying to retrieve it from the manifest.

Returns:
The offer id defined in the manifest.

setOverriddenOfferId

public void setOverriddenOfferId(java.lang.String offerId)
Set the offerId, overriding the one which would be read from the manifest.

Parameters:
offerId -

getProgramId

public java.lang.String getProgramId()

setOverriddenProgramId

public void setOverriddenProgramId(java.lang.String programId)